// 查看更多的猜你喜欢
getData()
$('.see-more').on('click', () =>{
     getData ()
})
function getData(){
  $.ajax({
    url: 'https://www.ymatou.com/guess/api/getGuessLikeProducts',
    // 如果是jsonp请求，就一定要传一个dataType，值必须是jsonp
    dataType: 'jsonp',
    data: {
      callback: 'jQuery112406969717441356811_1635062755701',
      pageIndex: '2',
      pageSize: '',
      _: +new Date()
    },
    success: res => {
      // console.log(res)
      var data = res.result.Products
      // console.log(data)
      if (res.status === 200) {
        data.forEach(item => {
          var li = `
                  <li class="product-item">
                  <a href="" class="product-img">
                      <img src="${item.MainPic}" alt="">
                  </a>
                  <a href="">
                      <p class="name">${item.Title}</p>
                  </a>
                  <p class="price">￥<b class="unit">${item.MaxPrice}</b></p>
                 </li>`
          $('.like-body>.product-list').append(li)
        })
      }
    }
  })
}
